package app.kernel.results;

import java.util.Vector;
// Written by: Ng Wen Long
public class QueryResult {

	public String QuerySignature;
	public Vector resultsTable = new Vector();
	
	public QueryResult(String qSignature, Vector results){
		
		QuerySignature = qSignature;
		if (results == null)
			resultsTable = new Vector();
		else
		    resultsTable = results;
		
	}
	
	public void addResult(String Result){
		
		resultsTable.add(Result);		
		
	}
	
	public Vector getResults(){
		
		return resultsTable;
	}
	
	public int Size(){
		
	    return resultsTable.size();	
	}
	
	public String toString(){
		
		String res="[Results Table]\n";
		
		for (int i=0; i<resultsTable.size(); i++){
			
			res+=" ("+i+") "+ (String)resultsTable.get(i)+"\n";
			
		}
		res+="\n";
		return res;
		
	}
	
}
